import layoutHeaderAside from '@/layout/header-aside'

// 由于懒加载页面太多的话会造成webpack热更新太慢，所以开发环境不使用懒加载，只有生产环境使用懒加载
const _import = require('@/libs/util.import.' + process.env.NODE_ENV)

const meta = { auth: true }

export default {
  path: '/system/organization',
  name: 'system-organization',
  meta,
  redirect: { name: 'system-organization-index' },
  component: layoutHeaderAside,
  children: (pre => [
    { path: 'user', name: `${pre}user`, component: _import('system/organization/user/index.vue'), meta: { ...meta, title: '员工' } },
    { path: 'personal', name: `${pre}personal`, component: _import('system/organization/user/personal.vue'), meta: { ...meta, title: '个人中心' } },
    { path: 'department', name: `${pre}department`, component: _import('system/organization/department/index.vue'), meta: { ...meta, title: '部门' } },
    { path: 'role', name: `${pre}role`, component: _import('system/organization/role/index.vue'), meta: { ...meta, title: '角色' } }
  ])('system-organization-')
}
